package com.foreknow.demo2;

/**
 * 方法重写
 */
public class Person {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "可以自定义要显示的内容";
    }

    public static void main(String[] args) {
        Person person = new Person();
        System.out.println(person.toString());

    }
}
